home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Utilities / Kenny / src / kenny.flex
Encoding:
Text File  |  1998-08-15  |  607 b   |  38 lines

  1. /*
  2.  * kenny.flex
  3.  *
  4.  * Produces a filter to convert a text file into a form suitable for
  5.  * reading by Kenny McCormick
  6.  *
  7.  * (c) Stephen Williams, 1998
  8.  */
  9.  
  10. %option outfile="kenny.c"
  11.  
  12. %{
  13.   static const char VER[] =
  14.     "\0$VER: Kenny 1.0 (10.8.98)\0$MRR: Mrrrr m.m (mm.m.mm)";
  15.   int r = 0;
  16. %}
  17.  
  18. %%
  19.  
  20. [[:punct:] \n\t]+    printf("%s", yytext); r = 0;
  21. [0-9]            printf("m"); r = 0;
  22. [ß-öø-ÿ]            |
  23. [[:lower:]]        printf("%c", r++ ? 'r' : 'm');
  24. [À-Þ]            |
  25. [[:upper:]]        printf("%c", r++ ? 'R' : 'M');
  26.  
  27. %%
  28.  
  29. /*
  30.  * C main() function
  31.  * Just runs the scanner from stdin to stdout
  32.  */
  33. int main(int dummy)
  34. {
  35.   yylex();
  36.   return 0;
  37. }
  38.